package com.cqc.crm.action;

import org.hibernate.criterion.DetachedCriteria;

import com.cqc.crm.domain.Linkman;
import com.cqc.crm.service.CustomerService;
import com.cqc.crm.service.LinkmanService;
import com.cqc.crm.utils.PageBean;
import com.opensymphony.xwork2.ModelDriven;

public class LinkmanAction extends BaseAction implements ModelDriven<Linkman>{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6245861223150117083L;
	private Linkman linkman=new Linkman();
	@Override
	public Linkman getModel() {
		return linkman;
	}
	
	
	private LinkmanService linkmanService;
	public void setLinkmanService(LinkmanService linkmanService) {
		this.linkmanService = linkmanService;
	}
	private CustomerService customerService;
	public void setCustomerService(CustomerService customerService) {
		this.customerService = customerService;
	}

	public String findByPage() {
		//创建criteria
		DetachedCriteria criteria = DetachedCriteria.forClass(Linkman.class);
		//获取pagebean
		PageBean<Linkman>  page=linkmanService.findByPage(this.getPageCode(),getPageSize(),criteria);
		super.push(page);
		return "toList";
	}



}
